#ifndef CCMDPARSER_H
#define CCMDPARSER_H

#include <QObject>

#include <QCommandLineParser>
#include <QCommandLineOption>
#include <QCoreApplication>
#include <QSocketNotifier>
#include <QtConcurrent/QtConcurrent>
#include <QDebug>
#include <QEventLoop>
#include "gui/example.h"
class CCmdParser : public QObject
{
    Q_OBJECT

public:
    explicit CCmdParser(QObject *parent = nullptr);

    void exec(){
        QCommandLineParser parser;
        parser.parse(QCoreApplication::arguments());
    }
    void sendError(const QByteArray&msg,const QByteArray&tail="\n");
    void sendMsg(const QByteArray&msg,const QByteArray&tail="\n");
    ~CCmdParser(){

    }
signals:
    void sCreateContext();
    void sInput(const QByteArray&msg);
protected slots:
    void onMainThreadRecv(const QByteArray&msg);
protected slots:
    void dealRecv();
protected:
    void onInternalRecv(const QByteArray &msg);
public:
    QVariantMap msgs;
    std::shared_ptr<Example> _app;
    bool _isQuit;
};

#endif // CCMDPARSER_H
